
delete asm_delib_6_12_dt a
where 
a.movimento <>'A' 
and a.movimento <>'IA' 
and a.movimento <>'AE' 
and a.datamisura = (select distinct min (datamisura)  from asm_delib_6_12_dt b
                                                                    where
                                                                    a.pod=b.pod
                                                                    AND CodContrDisp=(SELECT DISTINCT MAX(DP) FROM asm_delib_6_12_EXCEL))
 AND CodContrDisp=(SELECT DISTINCT MAX(DP) FROM asm_delib_6_12_EXCEL)